import { polarPoints } from "../algorithm/polar.js";
import { _transform } from '../math/transform.js'
import { _mirrorPoints } from '../algorithm/mirror.js'
import { _path2 } from './path2.js'
import { _mirrorColor } from '../common/index.js'


// 镜像函数升级，支持一笔画  ，替代polarShape
export const _oneline = (options, props) => {
    let points = polarPoints(options)
    let { transform, mirror } = options
    // 变形函数
    points = _transform(points, transform)
    // 镜像函数
    let ps = _mirrorPoints(points, mirror)
    let color = _mirrorColor(mirror)


    return _path2({
        ...options,
        points: ps,
        mirror: null,
        color
    }, props)
}